<?php
namespace app\common\model;

use think\Model;

class CollegeModel extends Model
{
    /**
     * 分类添加
     * @param array $data
     * @return bool|mixed
     * @throws \think\exception\PDOException
     */
    public function addCollege($data = [])
    {
        self::startTrans();
        try {
            $this->allowField(true)->save($data);
            $id = $this->id;
            self::commit();
            return $id;
        } catch (\Exception $exception) {
            self::rollback();
            return false;
        }
    }
}